﻿namespace Ngs.Data
{
    #region Using Directives
    using System;
    using System.Collections;
    using System.Collections.Generic;
    using System.Linq;
    using System.Linq.Expressions; 
    #endregion

    public interface IDataQuery<T> : IQueryable<T>, IEnumerable<T>, IEnumerable, IOrderedQueryable<T>, IOrderedQueryable
    {
        T First();

        T First(Expression<Func<T, bool>> predicate);

        IDataQuery<System.Linq.IGrouping<TKey, T>> GroupBy<TKey>(Expression<Func<T, TKey>> keySelector);

        IDataQuery<T> Include<M>(Expression<Func<T, M>> includeMember);

        IDataQuery<T> OfType();

        IDataQuery<TKey> OfType<TKey>();

        IDataQuery<T> OrderBy<TKey>(Expression<Func<T, TKey>> keySelector);

        IDataQuery<T> OrderByDescending<TKey>(Expression<Func<T, TKey>> keySelector);

        IDataQuery<T> Reverse();

        IDataQuery<T> Skip(int count);

        IDataQuery<T> Take(int count);

        IDataQuery<T> Where(Expression<Func<T, bool>> predicate);

        int Count();
    }
}
